<template>
  <div>
    <el-row style="padding: 0 0 10px 60px;border-bottom: 1px solid #ddd;">
      <el-button :type="show ? 'warning' : 'info'" size="small" @click="show = true">普通通道</el-button>
      <!-- <el-button :type="!show ? 'warning' : 'info'" size="small" @click="show = false">活动通道</el-button> -->
    </el-row>
    <transition name="fade" mode="out-in">
      <ordin-ary :address="address" :wxCatgroy="wx_categorys" :aliCategroy="ali_categorys" v-if="show"></ordin-ary>
      <!-- <gree-need :address="address" :wxCatgroy="wx_categorys" :aliCategroy="ali_categorys" v-else></gree-need> -->
    </transition>
  </div>
</template>

<script>
import GreeNeed from './fu_channel/activities'
import OrdinAry from './fu_channel/ordinary'
import { merchantChannelFuAliCategory, merchantChannelFuWxCategory } from '@/api/shop'

export default {
  components: {
    GreeNeed,
    OrdinAry
  },
  data() {
    return {
      show: true,
      ali_categorys: [],
      wx_categorys: []
    }
  },
  props: {
    address: {
      required: true,
      type: Array
    }
  },
  created() {
    merchantChannelFuAliCategory().then(res => {
      if (res.data.errorCode === 0) {
        this.ali_categorys = res.data.result
      } else {
        this.$message.error(res.data.errorMsg)
      }
    })
    merchantChannelFuWxCategory().then(res => {
      if (res.data.errorCode === 0) {
        this.wx_categorys = res.data.result
      } else {
        this.$message.error(res.data.errorMsg)
      }
    })
  }
}
</script>